{* $Id$ *}
{include_core file="admin/lib/header.html" title="合伙人仓库地址管理"}
  <div class="page-header border-bottom clearfix">
    <h2 class="left">{$user_info.nickname}仓库地址管理<span>在这里对合伙人仓库地址进行管理</span></h2>
    <a class="btn btn-default btn-sm right" href="{AnUrl('user/admin')}?{base64_decode($query_string)}">&lt;&nbsp;返回用户列表</a>
    <a href="{AnUrl("user/admin/add_dealer_address?id=$id")}&query_string={$query_string}" class="btn btn-success btn-sm right"><i class="icon-add"></i>添加仓库地址</a>
  </div>
  <!-- <div class="search-level1 clearfix" {if $is_advenced == 1}style="display:none;"{/if}>
    <form action="user/admin/show_area_list" method="get">
      <input type="hidden" name="id" value="{$id}" />
      <input type="hidden" name="is_advenced" value="0">
      <input type="hidden" name="status" value="{$status}">
      <input type="text" class="left" name="search_filter[user_name]" value="{$search_filter.user_name}">
      <button type="submit" class="btn btn-success btn-sm left">搜索</button>
      <a href="javascript:void(0);" class="close js_advanced {if $is_advenced == 1}js_isOpen open{/if}">高级搜索<em></em></a>
    </form>
  </div>
  <div class="search-form js_advancedForm" {if $is_advenced == 0}style="display:none;"{/if}>
    <form action="user/admin" method="get" class="js_focusSearchForm">
      <input type="hidden" name="is_advenced" value="1">
      <input type="hidden" name="id" value="{$id}" />
      <input type="hidden" name="status" value="{$status}">
      <p>
        <label for="" class="search-f-label">用户名：</label>
        <input type="text" class="search-f-ipt1" name="search_filter[user_name]" value="{$search_filter.user_name}">
      </p>
      <p>
      <label for="" class="search-f-label">注册时间：</label>
        <input type="text" class="search-f-ipt1 search-f-ipt2" name="search_filter[start_date]" value="{$search_filter.start_date}" id="startDate">
        <span class="search-f-line"></span>
        <input type="text" class="search-f-ipt1 search-f-ipt2" name="search_filter[end_date]" value="{$search_filter.end_date}" id="stopDate">
      </p>
      <p><label for="" class="search-f-label"></label><button type="submit" class="btn btn-success btn-xs js_searchBtn">搜索</button></p>
    </form>
  </div> -->
  
  <!--start:列表-->
  <table class="list-table">
    <!--  <caption>按状态：
      <a href='{AnUrl("user/admin/show_dealer_address_list?status=1&id=$id")}' {if $status == 1} class="label label-primary" {else} class="label label-default" {/if}>正常</a>
      <a href='{AnUrl("user/admin/show_dealer_address_list?status=0&id=$id")}' {if $status == 0} class="label label-primary" {else} class="label label-default" {/if}>已禁用</a>
    </caption>  -->
    <thead><tr>
      {if $status == 1}
      <th style="width:20px;"><input type="checkbox" class="selectAll"></th>
      {/if}
      <th style="min-width:20px;">省份</th>
      <th style="min-width:30px;">城市</th>
      <th style="min-width:30px;">区县</th>
      <th style="min-width:60px;">仓库详细地址</th>
      <th style="min-width:20px;">收货人</th>
      <th style="min-width:20px;">电话</th>
      <th style="min-width:20px;">是否默认</th>
      <th style="min-width:60px;">操作</th>
    </tr></thead>
    <tbody>
    	<!-- <tr>
    		<td class="js_province"></td>
    		<td class="js_city"></td>
    		<td class="js_county"></td>
    		<td class="js_detailAddress"></td>
    		<td class="js_addTime"></td>
    	</tr> -->
    	{foreach $dealer_address_list as $k => $v}
    	<tr id="dataList{$v.id}" {if $k%2 == 1} class="bg-gray"{/if} data-id="{$v.id}">
    		{if $status == 1}
	        <td><input type="checkbox" class="listSelect"></td>
    	    {/if}
    		<td class="js_province">{$v.province_name}</td>
    		<td class="js_city">{$v.city_name}</td>
    		<td class="js_county">{$v.county_name}</td>
    		<td class="js_detailAddress">{$v.dealer_address}</td>
            <td class="js_detailAddress">{$v.dealer_name}</td>
            <td class="js_detailAddress">{$v.dealer_mobile}</td>
            <td class="js_detailAddress">{if $v.is_default}是{else}{/if}</td>
    		<td>
            <a href="{AnUrl("user/admin/edit_dealer_address?user_id={$id}&id={$v.id}")}" class="btn btn-info btn-xs"><i class="icon-edit icon-white"></i>编辑</a>
            {if $v.status == 1}
              <a href="{AnUrl("user/admin/delete_dealer_address?id={$v.id}")}" class="btn btn-danger btn-xs deleteOne"><i class="icon-trash icon-white"></i>禁用</a>
            {elseif $v.status == 0}
              <a href="{AnUrl("user/admin/change_dealer_address_status?status=1&id={$v.id}")}" class="btn btn-success btn-xs changeStatus"><i class="icon-trash icon-white"></i>恢复</a>
            {/if}
          </td>
    	</tr>
    	{foreachelse}	
    	<tr><td class="txtleft" colspan="8">暂无数据</td></tr>
    	{/foreach}
    </tbody>
    {if $status == 1}
    <tfoot><tr><td><input type="checkbox" class="selectAll"></td><td colspan="8"><a href="{AnUrl("user/admin/delete_dealer_area")}" class="btn btn-danger btn-xs deleteAll">批量禁用</a></td></tr></tfoot>
    {/if}
  </table>
  <script type="text/javascript">
  
  $(function(){
   // 高级搜索
      $('.js_advanced').click(function(e){
        e.preventDefault();
        var thisObj = $(this);
        var outBox  = thisObj.closest('form');
        if (thisObj.hasClass('js_isOpen')) {
          thisObj.removeClass('js_isOpen open');
          outBox.find('input').show();
          outBox.find('button').show();
          $('.js_advancedForm').hide();
        } else {
          thisObj.addClass('js_isOpen open');
          outBox.find('input').hide();
          outBox.find('button').hide();
          $('.js_advancedForm').show();
        }
      });
    
    
  });
  

  
  </script>
  {include_core file="admin/lib/pager.html"}
<!--end:列表-->
{load_js file='zclip/jquery.zclip.min.js'}
{load_js file='zclip/ZeroClipboard.js'}
{include_core file="admin/lib/footer.html"}